package client.api;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import phasebook.client.msgs.MessageInfo;
import phasebook.client.msgs.MovementInfo;
import phasebook.client.msgs.PhotoInfo;
import phasebook.client.msgs.UserInfo;
import phasebook.client.msgs.UserProfileInfo;

public class CombinedResponse implements Serializable{
	private static final long serialVersionUID = -7214086280383790037L;
	private List<UserInfo> friends;
	private List<UserInfo> friendRequests;
	private List<UserInfo> myFriendRequests;
	private List<UserInfo> foundUsers;
	private List<MovementInfo> movements;
	private List<MessageInfo> messages;
	private List<UserProfileInfo> profiles;
	private List<PhotoInfo> photos;
	private Long userId;
	private String errorMsg;
	
	
	public List<UserInfo> getFriends() {
		return friends;
	}
	public CombinedResponse addFriends(UserInfo... friends) {
		if (this.friends==null)
			this.friends = new ArrayList<UserInfo>();
		if (friends!=null){
			this.friends.addAll(Arrays.asList(friends));
		}
		return this;
	}
	public List<UserInfo> getFriendRequests() {
		return friendRequests;
	}
	public CombinedResponse addFriendRequests(UserInfo... friendRequests) {
		if (this.friendRequests==null)
			this.friendRequests = new ArrayList<UserInfo>();
		if (friendRequests!=null){
			this.friendRequests.addAll(Arrays.asList(friendRequests));
		}
		return this;
	}
	public List<UserInfo> getMyFriendRequests() {
		return myFriendRequests;
	}
	public CombinedResponse addMyFriendRequests(UserInfo... myFriendRequests) {
		if (this.myFriendRequests==null)
			this.myFriendRequests = new ArrayList<UserInfo>();
		if (myFriendRequests!=null){
			this.myFriendRequests.addAll(Arrays.asList(myFriendRequests));
		}
		return this;
	}
	public List<MovementInfo> getMovements() {
		return movements;
	}
	public CombinedResponse addMovements(MovementInfo... movements) {
		if (this.movements==null)
			this.movements = new ArrayList<MovementInfo>();
		if (movements!=null){
			this.movements.addAll(Arrays.asList(movements));
		}
		return this;
	}
	public List<MessageInfo> getMessages() {
		return messages;
	}
	
	public CombinedResponse addMessages(MessageInfo... messages) {
		if (this.messages==null)
			this.messages = new ArrayList<MessageInfo>();
		if (messages!=null){
			this.messages.addAll(Arrays.asList(messages));
		}
		return this;
	}
	public List<UserProfileInfo> getProfiles() {
		return profiles;
	}
	public CombinedResponse addProfiles(UserProfileInfo... profiles) {
		if (this.profiles==null)
			this.profiles = new ArrayList<UserProfileInfo>();
		if (profiles!=null){
			this.profiles.addAll(Arrays.asList(profiles));
		}
		return this;
	}
	public List<PhotoInfo> getPhotos() {
		return photos;
	}
	public CombinedResponse addPhotos(PhotoInfo... photos) {
		if (this.photos==null)
			this.photos = new ArrayList<PhotoInfo>();
		if (photos!=null){
			this.photos.addAll(Arrays.asList(photos));
		}
		return this;
	}
	public Long getUserId() {
		return userId;
	}
	public CombinedResponse setUserId(Long userId) {
		this.userId = userId;
		return this;
	}
	public List<UserInfo> getFoundUsers() {
		return foundUsers;
	}
	public CombinedResponse addFoundUsers(UserInfo... foundUsers) {
		if (this.foundUsers==null)
			this.foundUsers = new ArrayList<UserInfo>();
		if (foundUsers!=null){
			this.foundUsers.addAll(Arrays.asList(foundUsers));
		}
		return this;
	}
	public String getErrorMsg() {
		return errorMsg;
	}
	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}
}